home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1990 by Glenn Gribble; all rights are reserved.
- // This program may be used for any purposes including inclusion in
- // for profit programs. If the source is copied, the copyright notice
- // must be included. Please send bug fixes/reports to glenn@synaptics.com
- // This program is distributed without any warranty.
-
- // A simple subroutine file
-
- #include "loaderTest.h"
- #include <stdio.h>
-
- // A hack to declare a procedure that gets called when this file
- // gets loaded
- #define MAGICINITPROCEDURENAMED(I) \
- class I { inline void II(); public: I() {II();} }; \
- static I needed; \
- inline void I::II()
- #define MAGICINITPROCEDURE() MAGICINITPROCEDURENAMED(init)
-
- #if 0
- int goop;
-
- int i = (int) &procA;
- int ig= (int) &goop;
-
- int ip = ((int) &procA) + 83;
- int igp= ((int) &goop) + 83;
-
- void yourProc() { }
-
- void myProc()
- {
- yourProc();
- }
- #endif
-
- void subProc(const char *msg)
- {
- //myProc();
- fprintf(stderr,"subProc: %s\n", msg);
- }
-
- MAGICINITPROCEDURE()
- {
- (*procA)("start-magicinit");
- fprintf(stderr,"subMagic\n");
- procA = subProc;
- (*procA)("end-magicinit");
- }
-